package mud.controller;

import mud.entity.AtomicReply;
import mud.support.Utility;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.atomic.AtomicLong;

@RestController
public class SimpleController {

    private final AtomicLong counter = new AtomicLong();

    @RequestMapping("/")
    @ResponseBody
    public AtomicReply index() {
        return new AtomicReply(counter.incrementAndGet(),
                Utility.getDateTime());
    }
}